<template>
    <div class="ViewData">
        <mt-header fixed title="数据查看">
            <mt-button icon="back" @click="back" slot="left"></mt-button>
        </mt-header>
        <mt-tab-container style="margin-top: 40px;" >
            <mt-tab-container-item>
                <router-link  :to="{ path: '/userList'}" class="reset-a">
                    <mt-cell  title="用户总数">{{userCount}}</mt-cell>
                </router-link>
                <router-link  :to="{ path: '/selectreview'}" class="reset-a">
                     <mt-cell  title="待审核资质用户数">{{userAuthCount}}</mt-cell>
                </router-link>
                <router-link  :to="{ path: '/reportList'}" class="reset-a">
                     <mt-cell  title="待审核举报数">{{complaitCount}}</mt-cell>
                </router-link>
                <router-link  :to="{ path: '/reflectedlist'}" class="reset-a">
                    <mt-cell  title="待处理提现订单">{{crash}}</mt-cell>
                </router-link>
            </mt-tab-container-item>
       </mt-tab-container>
    </div>
</template>

<script>
    import {
            datacount,
            back,
            loading
    } from '../common/api/api';
    export default {
        name: 'ViewData',
        data () {
            return {
                userCount : null,
                userAuthCount : null,
                userCarAuthCount : null,
                complaitCount : null,
                crash : null,
                createDialog: {
                    opened: false,
                    loading: false
                },
            }
        },
        components: {
            //Hello
        },
        methods: {
            back
        },
        created() {
            var vm = this;
            loading(true);
            datacount({}, {
                target: vm.createDialog
            })
            .then((data) => {
                console.log(data);
                 vm.createDialog.opened = false;
                if(data.errno == 0){
                    loading(false);
                    vm.userCount = data.data.userCount;//(用户总数),
                    vm.userAuthCount = data.data.userAuthCount;//待审核资质用户）,
                    vm.userCarAuthCount = data.data.userCarAuthCount;//（待审核车辆资质用户）,
                    vm.complaitCount = data.data.complaitCount;//待举报数）,
                    vm.crash = data.data.crash;//（待处理体现订单）
                }else{
                    loading(false);
                    Toast(data.errmsg);
                }
            });
        }
    }
</script>
